package chapter22.homework02;

public class Client {
    public static void main(String[] args) {
        //1.创建目标
        ConcreteManageSubject department = new ConcreteManageSubject();

        //2.创建观察者
        ConcreteObserver observerStudent = new ConcreteObserver();
        observerStudent.setObserverName("学生：张三");

        ConcreteObserver observerTeacher = new ConcreteObserver();
        observerTeacher.setObserverName("老师：李刚");

        //3.注册观察者到观察者列表中
        department.attch(observerStudent);
        department.attch(observerTeacher);

        //4.在目标处发布本系名称
        department.setDepartmentName("软件工程");
    }
}